<?php
/**
 * Created by PhpStorm.
 * User: bianti
 * Date: 2018/11/30
 * Time: 9:52
 */
namespace app\common\controller;

use think\Controller;

class Base extends Controller
{
    public $userId = null;

    /**
     * 需要登录的方法
     * @var array
     */
    protected $needLogin = [];

    public function _initialize()
    {
        $user = session('user');
        if (empty($user['id'])) {
            $this->redirect('index/index/login');
        }
    }
}